package org.wk.news.enums;
/**
 * @Description 资讯类型
 * @Param
 * @author ZhaoPing'an
 * @Date 2018/6/11 15:53
 */
public enum NewsType {
    ARTICLE("article","文章"),
    VIDEO("video","视频");
    private String code;
    private String name;

    public static NewsType containsCode(String code) {
        for (NewsType item : NewsType.values()) {
            if (item.getCode().equals(code)) {
                return item;
            }
        }
        return null;
    }

    NewsType(String code, String name) {

        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public void setName(String name) {
        this.name = name;
    }
}
